<include file="Remark:header"/>
<div class="wraper">
    <div class="top other">
        <p><a hre="javascript:history.back();" class="iconfont icon-zuo fl-left"></a>杭州生活品质总点评</p>
    </div>
    <div class="phenomenon clearfix marginb-50">
        <div class="title">{BEESCRM:$countPhenomenon}个候选现象</div>
        <volist name="data" id="vo">
        <a href="{BEESCRM::U('activity/remark/detail',array('act_id'=>$act_id,'pid'=>$vo['id'],'i'=>$i,'wechat_id'=>$wechat_id))}" class="list">
            <p class="number fl-left">{BEESCRM:$i}</p>
            <p>
                <span>年度现象</span>
                <span>{BEESCRM:$vo.title}</span>
            </p>
            <img src="{BEESCRM:$vo.picture}"/>
        </a>
        </volist>
    </div>
    <div class="btn-box">
        <if condition="$voteState neq null"><a href="#" class="btn">已投票</a><else/><a href="{BEESCRM::U('activity/remark/vote',array('act_id'=>$act_id,'wechat_id'=>$wechat_id))}" class="btn">投票</a></if>
        <a href="#" class="btn" id="recommend">举荐</a>
    </div>
    <div class="pop-main" id="recommend-box">
        <p class="pop-title">举荐</p>
        <span class="iconfont icon-guanbi guanbi"></span>
        <div class="object clearfix">
            <p>选择你的举荐对象</p>
            <div class="object-box clearfix" id="p-check">
                <span class="check" data-type="1">现象</span>
                <span data-type="2">人物</span>
                <span data-type="3">区块</span>
                <span data-type="4">活动</span>
            </div>
        </div>
        <div class="contain">
            <p>举荐对象</p>
            <input type="text" id="title" value=" "/>
            <p>举荐理由</p>
            <input type="text" id="reason" value=""/>
            <p>您的姓名</p>
            <input type="text" id="username" value=" "/>
            <p>您的联系电话</p>
            <input type="tel" id="mobile" value=""/>
        </div>
        <a href="#" class="btn green-btn" id="recSub">确认提交</a>
    </div>
</div>
<script src="/assets/activity/remark/js/jquery-2.1.0.min.js"></script>
<script>
    $(function(){
        $(window).load(function(){
            $('.pop-box1').hide();
        });
        $('#recommend').click(function(){
            $('.popbox').show();
            $('#recommend-box').addClass('up');
        });
        $('.guanbi').click(function(){
            $('.popbox').fadeOut(500);
            $('#conment-box').removeClass('up');
            $('#recommend-box').removeClass('up');
        });
    })
    
    $('#recSub').on('click',function(){
    	var type=$('#p-check').children('.check').data('type');
    	var title=$('#title').val();
    	var reason=$('#reason').val();
    	var username=$('#username').val();
    	var mobile=$('#mobile').val();
    	if(!title){
    		infotips('举荐对象不能为空',$('.submit_tips'));
    	}else if(!reason){
    		infotips('举荐理由不能为空',$('.submit_tips'));
    	}else if(!username){
    		infotips('用户名不能为空',$('.submit_tips'));
    	}else if(!/^(13[0-9]|14[0-9]|15[0-9]|18[0-9])\d{8}$/i.test(mobile)){ 
    		infotips('手机有误',$('.submit_tips'));
    	}else{
    		$.ajax({
                type:'post',
                dataType:'json',
                data:{'type':type,'title':title,'reason':reason,'username':username,'mobile':mobile},
                url:"{BEESCRM::U('/Activity/Remark/addRecommend',array('act_id'=>$act_id,'wechat_id'=>$wechat_id))}",
                success:function(data){
                    if(data.status == 'S'){
                        infotips('举荐成功',$('.submit_tips'),'right');
                        setTimeout('window.location.reload()',3000);
                    }else{
                        infotips('举荐失败，请稍后再试',$('.submit_tips'));
                    }
                },
                error:function(){
                    infotips('评论失败，请稍后再试',$('.submit_tips'));
                },
            });
    	}
    });
</script>
</body>

</html>
